
#include <BTorus>
#include "member_BTorus.h"

using namespace BWE;

#define member					(*(member_BTorus*)_ptr)
#define member_allocate()		_ptr = new member_BTorus(this)
#define member_release()		delete (member_BTorus*)_ptr

BTorus::BTorus()
{
	member_allocate();
}
BTorus::BTorus(float innerRadius, float outerRadius)
{
	member_allocate();
	member.radius = innerRadius;
	member.outerRadius = outerRadius;
	this->dirty();
}
BTorus::BTorus(float innerRadius, float outerRadius, int side, int divide)
{
	member_allocate();
	member.radius = innerRadius;
	member.outerRadius = outerRadius;
	member.side = side;
	member.divide = divide;
	this->dirty();
}
BTorus::~BTorus()
{

}

void BTorus::setRadius(float radius)
{
	if (member.radius != radius)
	{
		member.radius = radius;
		this->dirty();
	}
}
float BTorus::radius() const
{
	return member.radius;
}

void BTorus::setOuterRadius(float outerRadius)
{
	if (member.outerRadius != outerRadius)
	{
		member.outerRadius = outerRadius;
		this->dirty();
	}
}
float BTorus::outerRadius() const
{
	return member.outerRadius;
}

void BTorus::setSide(int side)
{
	if (member.side != side)
	{
		member.side = side;
		this->dirty();
	}
}
int BTorus::side() const
{
	return member.side;
}

void BTorus::setDivide(int divide)
{
	if (member.divide != divide)
	{
		member.divide = divide;
		this->dirty();
	}
}
int BTorus::divide() const
{
	return member.divide;
}

void BTorus::refresh()
{
	member.rebuild();
}
